"use strict";
module.exports = function (sequelize, DataTypes) {
    var AngleDeviceConfig = sequelize.define("AngleDeviceConfig", {
        prjId: {
            type: DataTypes.INTEGER,
            field: 'PrjId'
        },
        deviceId: {
            type: DataTypes.INTEGER,
            field: 'DeviceId'
        },
        resolution: {
            type: DataTypes.DOUBLE,
            field: 'Resolution'
        },
        section: {
            type: DataTypes.STRING,
            field: 'Section'
        },
        originX: {
            type: DataTypes.DOUBLE,
            field: 'OriginX'
        },
        originY: {
            type: DataTypes.DOUBLE,
            field: 'OriginY'
        },
        id: {
            type: DataTypes.INTEGER,
            field: 'Id',
            autoIncrement: true,
            primaryKey: true
        }
    }, {
            freezeTableName: true,
            timestamps: false,
            classMethods: {
                associate: function (models) {
                    AngleDeviceConfig.hasMany(models.AngleDeviceResult, {
                        foreignKey: "ConfigId"
                    });
                }
            }
        });

    return AngleDeviceConfig;
}